home *** CD-ROM | disk | FTP | other *** search
- Path: uunet!olivea!oliveb!veritas!amdcad!sun!exodus!bea.lbl.gov
- From: envbvs@bea.lbl.gov (Brian V. Smith)
- Newsgroups: comp.sources.x
- Subject: v13i069: xfig2, Patch10, Part02/04
- Message-ID: <16332@exodus.Eng.Sun.COM>
- Date: 6 Jul 91 06:59:11 GMT
- References: <csx-13i068-xfig2.9@uunet.UU.NET>
- Sender: news@exodus.Eng.Sun.COM
- Lines: 1920
- Approved: argv@sun.com
-
- Submitted-by: envbvs@bea.lbl.gov (Brian V. Smith)
- Posting-number: Volume 13, Issue 69
- Archive-name: xfig2.9/patch10.02
- Patch-To: xfig2.9: Volume 8, Issue 10-30
- Patch-To: xfig2.9: Volume 10, Issue 26-31
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 2 (of 4)."
- # Contents: patch10.3
- # Wrapped by envbvs@bea.lbl.gov.lbl.gov on Fri Jun 14 14:37:02 1991
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'patch10.3' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'patch10.3'\"
- else
- echo shar: Extracting \"'patch10.3'\" \(51091 characters\)
- sed "s/^X//" >'patch10.3' <<'END_OF_FILE'
- X*** @xfig.pl9/movept.c Wed May 16 14:31:20 1990
- X--- ./movept.c Mon Jun 3 11:14:27 1991
- X***************
- X*** 13,21 ****
- X #include "object.h"
- X #include "paintop.h"
- X
- X- #define TOLERANCE 3
- X extern int latexline_mode, latexarrow_mode;
- X extern int magnet_mode;
- X
- X extern (*canvas_kbd_proc)();
- X extern (*canvas_locmove_proc)();
- X--- 13,22 ----
- X #include "object.h"
- X #include "paintop.h"
- X
- X extern int latexline_mode, latexarrow_mode;
- X extern int magnet_mode;
- X+ extern int grid2_mode;
- X+ extern appresStruct appres;
- X
- X extern (*canvas_kbd_proc)();
- X extern (*canvas_locmove_proc)();
- X***************
- X*** 43,48 ****
- X--- 44,50 ----
- X extern move_cbrbox(), move_cbdbox();
- X
- X extern int init_move_point();
- X+ extern point_search();
- X extern int move_linepoint(), fix_movedlinepoint();
- X extern int move_latexlinepoint(), fix_movedlatexlinepoint();
- X extern int fix_box();
- X***************
- X*** 63,69 ****
- X {
- X canvas_kbd_proc = null_proc;
- X canvas_locmove_proc = null_proc;
- X! canvas_leftbut_proc = init_move_point;
- X canvas_middlebut_proc = null_proc;
- X canvas_rightbut_proc = set_popupmenu;
- X set_cursor(&pick9_cursor);
- X--- 65,72 ----
- X {
- X canvas_kbd_proc = null_proc;
- X canvas_locmove_proc = null_proc;
- X! init_point_search(init_move_point);
- X! canvas_leftbut_proc = point_search;
- X canvas_middlebut_proc = null_proc;
- X canvas_rightbut_proc = set_popupmenu;
- X set_cursor(&pick9_cursor);
- X***************
- X*** 70,100 ****
- X reset_action_on();
- X }
- X
- X! init_move_point(x, y)
- X! int x, y;
- X {
- X Boolean Ok=True;
- X
- X! if ((line = line_point_search(x, y, TOLERANCE,
- X! &left_point, &moved_point)) != NULL) {
- X init_linepointmoving(line);
- X! }
- X! else if ((spline = spline_point_search(x, y,
- X! TOLERANCE, &left_point, &moved_point)) != NULL){
- X init_splinepointmoving(spline);
- X! }
- X! else if ((ellipse = ellipse_point_search(x, y, TOLERANCE,
- X! &movedpoint_num)) != NULL) {
- X if (!init_ellipsepointmoving(ellipse)) /* selected center, ignore */
- X Ok=False;
- X! }
- X! else if ((arc = arc_point_search(x, y, TOLERANCE,
- X! &movedpoint_num)) != NULL) {
- X init_arcpointmoving(arc);
- X! }
- X! else {
- X return;
- X! }
- X if (Ok) /* movepoint went ok */
- X {
- X canvas_leftbut_proc = canvas_rightbut_proc = null_proc;
- X--- 73,111 ----
- X reset_action_on();
- X }
- X
- X! init_move_point(obj, type, x, y, p, q)
- X! char *obj;
- X! int type,x,y;
- X! F_point *p,*q;
- X {
- X Boolean Ok=True;
- X
- X! left_point= p;
- X! moved_point= q;
- X! switch(type)
- X! { case O_POLYLINE:
- X! line=(F_line *) obj;
- X init_linepointmoving(line);
- X! break;
- X! case O_SPLINE:
- X! spline=(F_spline *) obj;
- X init_splinepointmoving(spline);
- X! break;
- X! case O_ELLIPSE:
- X! movedpoint_num=(int) p; /* stored in F_point */
- X! ellipse=(F_ellipse *) obj;
- X if (!init_ellipsepointmoving(ellipse)) /* selected center, ignore */
- X Ok=False;
- X! break;
- X! case O_ARC:
- X! movedpoint_num=(int) p; /* stored in F_point */
- X! arc=(F_arc *) obj;
- X init_arcpointmoving(arc);
- X! break;
- X! default:
- X return;
- X! break;
- X! }
- X if (Ok) /* movepoint went ok */
- X {
- X canvas_leftbut_proc = canvas_rightbut_proc = null_proc;
- X***************
- X*** 309,325 ****
- X switch (movedpoint_num) {
- X case 0 :
- X pw_vector(canvas_win, cur_x, cur_y,
- X! arc->point[1].x, arc->point[1].y, op, 1, SOLID_LINE, 0.0);
- X break;
- X case 1 :
- X pw_vector(canvas_win, arc->point[0].x, arc->point[0].y,
- X! cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
- X pw_vector(canvas_win, arc->point[2].x, arc->point[2].y,
- X! cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
- X break;
- X default :
- X pw_vector(canvas_win, arc->point[2].x, arc->point[2].y,
- X! cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
- X }
- X }
- X
- X--- 320,336 ----
- X switch (movedpoint_num) {
- X case 0 :
- X pw_vector(canvas_win, cur_x, cur_y,
- X! arc->point[1].x, arc->point[1].y, op, 1, RUBBER_LINE, 0.0);
- X break;
- X case 1 :
- X pw_vector(canvas_win, arc->point[0].x, arc->point[0].y,
- X! cur_x, cur_y, op, 1, RUBBER_LINE, 0.0);
- X pw_vector(canvas_win, arc->point[2].x, arc->point[2].y,
- X! cur_x, cur_y, op, 1, RUBBER_LINE, 0.0);
- X break;
- X default :
- X pw_vector(canvas_win, arc->point[2].x, arc->point[2].y,
- X! cur_x, cur_y, op, 1, RUBBER_LINE, 0.0);
- X }
- X }
- X
- X***************
- X*** 552,558 ****
- X
- X draw_pointlink(INV_PAINT);
- X latex_endpoint(latex_fix_x, latex_fix_y, x, y, &cur_x, &cur_y,
- X! latexarrow_mode, (magnet_mode)? 5: 1);
- X draw_pointlink(INV_PAINT);
- X c = (x == cur_x && y == cur_y)? &null_cursor: &crosshair_cursor;
- X if (c != cur_latexcursor) {
- X--- 563,569 ----
- X
- X draw_pointlink(INV_PAINT);
- X latex_endpoint(latex_fix_x, latex_fix_y, x, y, &cur_x, &cur_y,
- X! latexarrow_mode, (magnet_mode)? (appres.INCHES? 5:(grid2_mode? 15:3)): 1);
- X draw_pointlink(INV_PAINT);
- X c = (x == cur_x && y == cur_y)? &null_cursor: &crosshair_cursor;
- X if (c != cur_latexcursor) {
- X***************
- X*** 616,622 ****
- X {
- X draw_pointlink(INV_PAINT);
- X latex_endpoint(latex_fix_x, latex_fix_y, x, y, &x, &y,
- X! latexarrow_mode, (magnet_mode)? 5: 1);
- X if (cur_latexcursor != &crosshair_cursor)
- X set_temp_cursor(&crosshair_cursor);
- X win_setmouseposition(canvas_win, x, y);
- X--- 627,633 ----
- X {
- X draw_pointlink(INV_PAINT);
- X latex_endpoint(latex_fix_x, latex_fix_y, x, y, &x, &y,
- X! latexarrow_mode, (magnet_mode)? (appres.INCHES? 5:(grid2_mode? 15:3)): 1);
- X if (cur_latexcursor != &crosshair_cursor)
- X set_temp_cursor(&crosshair_cursor);
- X win_setmouseposition(canvas_win, x, y);
- X***************
- X*** 662,671 ****
- X
- X if (left_point != NULL) {
- X pw_vector(canvas_win, left_point->x, left_point->y,
- X! cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
- X }
- X if ((p = moved_point->next) != NULL) {
- X! pw_vector(canvas_win, p->x, p->y, cur_x, cur_y, op, 1, SOLID_LINE, 0.0);
- X }
- X }
- X
- X--- 673,682 ----
- X
- X if (left_point != NULL) {
- X pw_vector(canvas_win, left_point->x, left_point->y,
- X! cur_x, cur_y, op, 1, RUBBER_LINE, 0.0);
- X }
- X if ((p = moved_point->next) != NULL) {
- X! pw_vector(canvas_win, p->x, p->y, cur_x, cur_y, op, 1, RUBBER_LINE, 0.0);
- X }
- X }
- X
- X*** @xfig.pl9/msgsw.c Mon Apr 30 12:13:35 1990
- X--- ./msgsw.c Mon Jun 3 10:55:32 1991
- X***************
- X*** 15,21 ****
- X #include "paintop.h"
- X #include "psfonts.h"
- X
- X- extern int errno;
- X extern int action_on;
- X extern null_proc();
- X
- X--- 15,20 ----
- X*** @xfig.pl9/object.h Wed Apr 11 10:56:21 1990
- X--- ./object.h Mon Jun 3 11:16:32 1991
- X***************
- X*** 203,208 ****
- X--- 203,210 ----
- X #define SOLID_LINE 0
- X #define DASH_LINE 1
- X #define DOTTED_LINE 2
- X+ #define RUBBER_LINE 3
- X+ #define PANEL_LINE 4
- X
- X #define CLOSED_PATH 0
- X #define OPEN_PATH 1
- X*** @xfig.pl9/panel.h Wed Apr 25 09:49:47 1990
- X--- ./panel.h Mon Jun 3 11:16:47 1991
- X***************
- X*** 570,572 ****
- X--- 570,602 ----
- X 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00};
- X mpr_static(blank_ic, 32, 32, 1, blank_image);
- X
- X+
- X+
- X+ static char zoom_image[] = {
- X+ 0xff,0xff,0xff,0xff,0x01,0x00,0x00,0x80,0x01,0x0f,0x00,0x80,
- X+ 0x03,0x08,0x00,0x80,0x01,0xe4,0x6e,0xc1,0x09,0xa2,0xaa,0x82,
- X+ 0x01,0xa1,0xaa,0xa2,0x21,0xef,0xae,0x82,0x01,0x00,0x00,0x90,
- X+ 0x81,0x00,0x00,0x80,0x01,0x00,0x00,0x88,0x01,0x02,0x00,0x80,
- X+ 0x01,0x00,0x00,0x84,0x01,0x08,0x00,0x80,0x01,0x00,0x00,0x82,
- X+ 0x01,0x20,0x00,0x80,0x01,0x40,0x55,0x81,0x01,0x00,0x00,0x80,
- X+ 0x01,0x40,0x00,0x81,0x01,0x00,0x00,0x80,0x01,0x40,0x00,0x81,
- X+ 0x01,0x00,0x00,0x80,0x01,0x40,0x00,0x81,0x01,0x00,0x00,0x80,
- X+ 0x01,0x40,0x55,0x81,0x01,0x10,0x00,0x80,0x01,0x04,0x00,0x84,
- X+ 0x01,0x01,0x00,0x80,0x41,0x00,0x00,0x90,0x11,0x00,0x00,0x80,
- X+ 0x05,0x00,0x00,0xc0,0xff,0xff,0xff,0xff};
- X+ mpr_static(zoom_ic, 32, 32, 1, zoom_image);
- X+
- X+
- X+ static char pan_image[] = {
- X+ 0x00,0x00,0x00,0x00,0x00,0x00,0x1c,0x00,0x00,0x00,0x24,0x00,
- X+ 0x00,0x00,0x24,0x00,0x00,0x40,0x9c,0x2b,0x00,0xe0,0x44,0x5a,
- X+ 0x00,0x50,0x45,0x4a,0x00,0x40,0xc4,0x4b,0x00,0x40,0x00,0x00,
- X+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xff,0x1f,0x00,
- X+ 0x00,0x01,0x10,0x00,0x00,0x01,0x10,0x00,0x00,0x01,0x10,0x00,
- X+ 0x08,0x01,0x10,0x02,0x04,0x01,0x10,0x04,0x3e,0x01,0x90,0x0f,
- X+ 0x04,0x01,0x10,0x04,0x08,0x01,0x10,0x02,0x00,0x01,0x10,0x00,
- X+ 0x00,0x01,0x10,0x00,0x00,0x01,0x10,0x00,0x00,0xff,0x1f,0x00,
- X+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x40,0x00,0x00,
- X+ 0x00,0x40,0x00,0x00,0x00,0x50,0x01,0x00,0x00,0xe0,0x00,0x00,
- X+ 0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00};
- X+ mpr_static(pan_ic, 32, 32, 1, pan_image);
- X*** @xfig.pl9/patchlevel.h Fri Jun 29 09:14:55 1990
- X--- ./patchlevel.h Mon Jun 3 10:56:21 1991
- X***************
- X*** 1 ****
- X! #define PATCHLEVEL 9
- X--- 1 ----
- X! #define PATCHLEVEL 10
- X*** @xfig.pl9/popup.c Thu Sep 20 16:39:55 1990
- X--- ./popup.c Wed Jun 12 11:33:46 1991
- X***************
- X*** 18,23 ****
- X--- 18,24 ----
- X extern char current_file[];
- X extern int cur_command;
- X extern char cut_buf_name[];
- X+ extern int action_on;
- X
- X extern put_msg();
- X extern init_msg_receiving();
- X***************
- X*** 172,178 ****
- X int menu_code = (int)mi->info;
- X
- X if (cur_command == F_TEXT)
- X! finish_text_input();
- X /* char_handler(CR); */ /* old method */
- X
- X switch(menu_code) {
- X--- 173,179 ----
- X int menu_code = (int)mi->info;
- X
- X if (cur_command == F_TEXT)
- X! save_finish_text_input();
- X /* char_handler(CR); */ /* old method */
- X
- X switch(menu_code) {
- X***************
- X*** 240,247 ****
- X XtPopdown(menu);
- X }
- X
- X quit()
- X! {
- X /* delete the cut buffer only if it is a temporary file */
- X if(strncmp(cut_buf_name, "/tmp",4) == 0)
- X unlink(cut_buf_name);
- X--- 241,262 ----
- X XtPopdown(menu);
- X }
- X
- X+ /* finish text input saving figure_modified flag first. finish_text_input()
- X+ always sets the figure_modified flag, but if we weren't actually inputting
- X+ text then we don't want to set the flag */
- X+
- X+ save_finish_text_input()
- X+ {
- X+ int save_modified_flag = figure_modified;
- X+
- X+ if (! action_on)
- X+ return; /* weren't actually inputting text */
- X+ finish_text_input();
- X+ figure_modified = save_modified_flag;
- X+ }
- X+
- X quit()
- X! {
- X /* delete the cut buffer only if it is a temporary file */
- X if(strncmp(cut_buf_name, "/tmp",4) == 0)
- X unlink(cut_buf_name);
- X*** @xfig.pl9/printfonts.c Thu Apr 12 15:47:46 1990
- X--- ./printfonts.c Fri Jun 14 14:20:42 1991
- X***************
- X*** 137,148 ****
- X--- 137,162 ----
- X setup_fontmenu()
- X {
- X register int i;
- X+ Pixel bg,fg;
- X+ Arg args[2];
- X
- X /* Create the bitmaps */
- X
- X+ /* OpenWindows bug doesn't handle the one-plane bitmap on a multi-plane display */
- X+ #ifdef OPENWIN
- X+ XtSetArg(args[0], XtNforeground, &fg); /* get the foreground/background of the widget */
- X+ XtSetArg(args[1], XtNbackground, &bg);
- X+ XtGetValues(fontpane[0], args, TWO);
- X+
- X for (i=0; i<NUMFONTS; i++)
- X+ font_menu_bitmaps[i] = XCreatePixmapFromBitmapData(tool_d,XtWindow(psfont),
- X+ font_menu_bits[i], FONT_PANE_WIDTH, FONT_PANE_HEIGHT, fg, bg,
- X+ XDefaultDepthOfScreen(tool_s));
- X+ #else
- X+ for (i=0; i<NUMFONTS; i++)
- X font_menu_bitmaps[i] = XCreateBitmapFromData(tool_d,XtWindow(psfont),
- X font_menu_bits[i], FONT_PANE_WIDTH, FONT_PANE_HEIGHT);
- X+ #endif
- X psfont_args[6].value = (XtArgVal) font_menu_bitmaps[0];
- X XtSetValues(psfont, &psfont_args[6], 1); /* show default font in window */
- X
- X*** @xfig.pl9/read.c Fri Jul 6 10:48:42 1990
- X--- ./read.c Mon Jun 3 11:43:39 1991
- X***************
- X*** 15,21 ****
- X
- X extern F_arrow *make_arrow();
- X extern char *calloc();
- X- extern int errno;
- X
- X static F_ellipse *read_ellipseobject();
- X static F_line *read_lineobject();
- X--- 15,20 ----
- X***************
- X*** 35,42 ****
- X char *file;
- X int err;
- X {
- X- extern char *sys_errlist[];
- X-
- X if (err == 0) /* Successful read */
- X return;
- X #ifdef ENAMETOOLONG
- X--- 34,39 ----
- X***************
- X*** 675,681 ****
- X if (n != 13 && n != 14) {
- X put_msg(Err_incomp, "text", line_no);
- X free((char*)t);
- X! /* return(NULL); */
- X }
- X if (n == 13) {
- X /* Read in the remainder of the text object. */
- X--- 672,678 ----
- X if (n != 13 && n != 14) {
- X put_msg(Err_incomp, "text", line_no);
- X free((char*)t);
- X! return(NULL);
- X }
- X if (n == 13) {
- X /* Read in the remainder of the text object. */
- X*** @xfig.pl9/read1_3.c Tue May 1 16:40:17 1990
- X--- ./read1_3.c Mon Jun 3 10:55:54 1991
- X***************
- X*** 30,39 ****
- X #define DRAW_COMPOUND 13
- X
- X extern F_arrow *forward_arrow(), *backward_arrow();
- X- extern int errno;
- X- extern char *sys_errlist[];
- X- extern int sys_nerr, errno;
- X-
- X static F_ellipse *read_1_3_ellipseobject();
- X static F_line *read_1_3_lineobject();
- X static F_text *read_1_3_textobject();
- X--- 30,35 ----
- X*** @xfig.pl9/redisplay.c Thu Apr 26 10:21:44 1990
- X--- ./redisplay.c Mon Jun 3 12:03:15 1991
- X***************
- X*** 4,9 ****
- X--- 4,11 ----
- X * Copyright (c) 1988 by Supoj Sutanthavibul (supoj@sally.UTEXAS.EDU)
- X * Febuary 1988.
- X *
- X+ * Depth code by Mike Lutz 1991
- X+ *
- X * %W% %G%
- X */
- X #include "fig.h"
- X***************
- X*** 15,136 ****
- X extern int compoundbox_shown;
- X extern int foreground_color, background_color;
- X
- X redisplay_objects(objects)
- X F_compound *objects;
- X! {
- X! int fill;
- X
- X! if (objects == NULL)
- X! return;
- X for (fill=1; fill >= 0; fill--)
- X! {
- X! redisplay_arcobject(objects->arcs,fill);
- X! redisplay_compoundobject(objects->compounds,fill);
- X! redisplay_ellipseobject(objects->ellipses,fill);
- X! redisplay_lineobject(objects->lines,fill);
- X! redisplay_splineobject(objects->splines,fill);
- X! }
- X! if (pointmarker_shown) /* show the point markers if they are on */
- X! toggle_pointmarker();
- X! if (compoundbox_shown) {
- X! F_compound *c;
- X! for (c = objects->compounds; c != NULL; c = c->next)
- X! draw_compoundbox(c, INV_PAINT); /* show the compound boxes */
- X }
- X /* text doesn't have fill mode */
- X! redisplay_textobject(objects->texts);
- X }
- X
- X! redisplay_arcobject(arcs,fill)
- X F_arc *arcs;
- X! int fill;
- X! {
- X! F_arc *arc;
- X
- X! for (arc = arcs; arc != NULL; arc = arc->next)
- X {
- X! if ((fill && arc->area_fill) ||
- X! (fill==0 && arc->area_fill == 0))
- X! draw_arc(arc, foreground_color);
- X }
- X }
- X
- X! redisplay_ellipseobject(ellipses,fill)
- X F_ellipse *ellipses;
- X int fill;
- X! {
- X! F_ellipse *e;
- X
- X! for (e = ellipses; e != NULL; e = e->next)
- X {
- X! if ((fill && e->area_fill) ||
- X! (fill==0 && e->area_fill == 0))
- X! draw_ellipse(e, foreground_color);
- X }
- X }
- X
- X! redisplay_lineobject(lines,fill)
- X F_line *lines;
- X int fill;
- X! {
- X! F_line *line;
- X
- X! for (line = lines; line != NULL; line = line->next)
- X {
- X! if ((fill && line->area_fill) ||
- X! (fill==0 && line->area_fill == 0))
- X! draw_line(line, PAINT);
- X }
- X }
- X
- X! redisplay_splineobject(splines,fill)
- X F_spline *splines;
- X int fill;
- X! {
- X! F_spline *s;
- X!
- X! for (s = splines; s != NULL; s = s->next)
- X {
- X! if ((fill && s->area_fill) ||
- X! (fill==0 && s->area_fill == 0))
- X! draw_spline(s, PAINT);
- X }
- X }
- X
- X! redisplay_textobject(texts)
- X! F_text *texts;
- X! {
- X! F_text *t;
- X
- X! for (t = texts; t != NULL; t = t->next)
- X! draw_text(t, PAINT);
- X }
- X
- X! redisplay_compoundobject(compounds,fill)
- X F_compound *compounds;
- X! int fill;
- X {
- X F_compound *c;
- X
- X for(c = compounds; c != NULL; c = c->next) {
- X! redisplay_arcobject(c->arcs,fill);
- X! redisplay_compoundobject(c->compounds,fill);
- X! redisplay_ellipseobject(c->ellipses,fill);
- X! redisplay_lineobject(c->lines,fill);
- X! redisplay_splineobject(c->splines,fill);
- X
- X /* no filled text mode, just do text on non-filled pass */
- X if(fill==0) {
- X! redisplay_textobject(c->texts);
- X }
- X }
- X }
- X
- X redisplay_canvas()
- X {
- X extern F_compound objects;
- X
- X clear_canvas();
- X set_temp_cursor(&wait_cursor);
- X redisplay_objects(&objects);
- X redisplay_grid();
- X--- 17,467 ----
- X extern int compoundbox_shown;
- X extern int foreground_color, background_color;
- X
- X+ /*
- X+ * Support for rendering based on correct object depth. A simple
- X+ * depth based caching scheme; anything more will require major
- X+ * surgery on the object data structures that will percolate throughout
- X+ * program.
- X+ */
- X+
- X+ #define MAXDEPTH (10)
- X+
- X+ /*
- X+ * One ``counts'' structure for each object type at each nesting depth from
- X+ * 0 to MAXDEPTH - 1. We track both the number of objects per type per depth,
- X+ * as well as the number of objects drawn so far per type per depth to cut down
- X+ * on search loop overhead.
- X+ */
- X+
- X+ struct counts
- X+ {
- X+ unsigned num_arcs ; /* # arcs at this depth */
- X+ unsigned num_lines ; /* # lines at this depth */
- X+ unsigned num_ellipses ; /* # ellipses at this depth */
- X+ unsigned num_splines ; /* # splines at this depth */
- X+ unsigned num_texts ; /* # texts at this depth */
- X+ unsigned cnt_arcs ; /* count of arcs drawn at this depth */
- X+ unsigned cnt_lines ; /* count of lines drawn at this depth */
- X+ unsigned cnt_ellipses ; /* count of ellipses drawn at this depth */
- X+ unsigned cnt_splines ; /* count of splines drawn at this depth */
- X+ unsigned cnt_texts ; /* count of texts drawn at this depth */
- X+ } ;
- X+
- X+ /*
- X+ * The array of ``counts'' structures. All objects at depth >= MAXDEPTH
- X+ * are accounted for in the counts[MAXDEPTH] entry.
- X+ */
- X+
- X+ struct counts counts[MAXDEPTH + 1] ;
- X+
- X+ /*
- X+ * Minimum and maximum functions.
- X+ */
- X+
- X+ static int imin(x, y)
- X+ int x ;
- X+ int y ;
- X+ {
- X+ return (x <= y) ? x : y ;
- X+ }
- X+
- X+ static int imax(x, y)
- X+ int x ;
- X+ int y ;
- X+ {
- X+ return (x >= y) ? x : y ;
- X+ }
- X+
- X+ /*
- X+ * Function to clear the array of object counts prior to each redraw.
- X+ */
- X+
- X+ static void clearcounts()
- X+ {
- X+ register struct counts *cp ;
- X+
- X+ for (cp = &counts[0] ; cp <= &counts[MAXDEPTH] ; ++cp)
- X+ {
- X+ cp->num_arcs = 0 ;
- X+ cp->num_lines = 0 ;
- X+ cp->num_ellipses = 0 ;
- X+ cp->num_splines = 0 ;
- X+ cp->num_texts = 0 ;
- X+ cp->cnt_arcs = 0 ;
- X+ cp->cnt_lines = 0 ;
- X+ cp->cnt_ellipses = 0 ;
- X+ cp->cnt_splines = 0 ;
- X+ cp->cnt_texts = 0 ;
- X+ }
- X+ }
- X+
- X+ unsigned int max_depth;
- X+ static int this_depth;
- X+
- X redisplay_objects(objects)
- X F_compound *objects;
- X! {
- X! int fill;
- X! int depth ;
- X!
- X! if (objects == NULL)
- X! return;
- X
- X! /*
- X! * Clear object counts, and then get the max. depth of any object
- X! * from the max. depths of each object type in the top level compound.
- X! */
- X!
- X! clearcounts() ;
- X! max_depth = imax(arc_depths(objects->arcs),
- X! imax(line_depths(objects->lines),
- X! imax(ellipse_depths(objects->ellipses),
- X! imax(compound_depths(objects->compounds),
- X! imax(text_depths(objects->texts),
- X! spline_depths(objects->splines)))))) ;
- X!
- X! /*
- X! * A new outer loop, executing once per depth level from max_depth
- X! * down to 0 (negative depths are not supported). The code inside
- X! * the loop is the original code for redisplay_objects.
- X! */
- X!
- X! for (depth = max_depth ; depth >= 0 ; --depth)
- X! {
- X for (fill=1; fill >= 0; fill--)
- X! {
- X! redisplay_arcobject(objects->arcs, depth, fill);
- X! redisplay_compoundobject(objects->compounds, depth, fill);
- X! redisplay_ellipseobject(objects->ellipses, depth, fill);
- X! redisplay_lineobject(objects->lines, depth, fill);
- X! redisplay_splineobject(objects->splines, depth, fill);
- X }
- X /* text doesn't have fill mode */
- X! redisplay_textobject(objects->texts, depth);
- X }
- X
- X! /*
- X! * Point markers and compounds, not being ``real objects'', are handled
- X! * outside the depth loop.
- X! */
- X!
- X! if (pointmarker_shown) /* show the point markers if they are on */
- X! toggle_pointmarker();
- X! if (compoundbox_shown)
- X! {
- X! F_compound *c;
- X! for (c = objects->compounds; c != NULL; c = c->next)
- X! draw_compoundbox(c, INV_PAINT); /* show the compound boxes */
- X! }
- X! }
- X!
- X! /*
- X! * Find the maximum depth of any arc, recording the number of arcs per
- X! * each level along the way.
- X! */
- X!
- X! int arc_depths(arcs)
- X F_arc *arcs;
- X! {
- X! int maxdepth = 0 ;
- X! F_arc *fp ;
- X
- X! for (fp = arcs ; fp != NULL ; fp = fp->next )
- X! {
- X! if (maxdepth < fp->depth)
- X! maxdepth = fp->depth ;
- X!
- X! ++counts[imin(fp->depth, MAXDEPTH)].num_arcs ;
- X! }
- X! return maxdepth ;
- X! }
- X!
- X! /*
- X! * Find the maximum depth of any line, recording the number of lines per
- X! * each level along the way.
- X! */
- X!
- X! int line_depths(lines)
- X! F_line *lines;
- X! {
- X! int maxdepth = 0 ;
- X! F_line *fp ;
- X!
- X! for (fp = lines ; fp != NULL ; fp = fp->next )
- X! {
- X! if (maxdepth < fp->depth)
- X! maxdepth = fp->depth ;
- X!
- X! ++counts[imin(fp->depth, MAXDEPTH)].num_lines ;
- X! }
- X! return maxdepth ;
- X! }
- X!
- X! /*
- X! * Find the maximum depth of any ellipse, recording the number of ellipses
- X! * per each level along the way.
- X! */
- X!
- X! int ellipse_depths(ellipses)
- X! F_ellipse *ellipses;
- X! {
- X! int maxdepth = 0 ;
- X! F_ellipse *fp ;
- X!
- X! for (fp = ellipses ; fp != NULL ; fp = fp->next )
- X! {
- X! if (maxdepth < fp->depth)
- X! maxdepth = fp->depth ;
- X!
- X! ++counts[imin(fp->depth, MAXDEPTH)].num_ellipses ;
- X! }
- X! return maxdepth ;
- X! }
- X!
- X! /*
- X! * Find the maximum depth of any spline, recording the number of splines
- X! * per each level along the way.
- X! */
- X!
- X! int spline_depths(splines)
- X! F_spline *splines;
- X! {
- X! int maxdepth = 0 ;
- X! F_spline *fp ;
- X!
- X! for (fp = splines ; fp != NULL ; fp = fp->next )
- X! {
- X! if (maxdepth < fp->depth)
- X! maxdepth = fp->depth ;
- X!
- X! ++counts[imin(fp->depth, MAXDEPTH)].num_splines ;
- X! }
- X! return maxdepth ;
- X! }
- X!
- X! /*
- X! * Find the maximum depth of any text, recording the number of texts
- X! * per each level along the way.
- X! */
- X!
- X! int text_depths(texts)
- X! F_text *texts;
- X! {
- X! int maxdepth = 0 ;
- X! F_text *fp ;
- X!
- X! for (fp = texts ; fp != NULL ; fp = fp->next )
- X! {
- X! if (maxdepth < fp->depth)
- X! maxdepth = fp->depth ;
- X!
- X! ++counts[imin(fp->depth, MAXDEPTH)].num_texts ;
- X! }
- X! return maxdepth ;
- X! }
- X!
- X! /*
- X! * Find the maximum depth of any of the objects contained in the
- X! * compound.
- X! */
- X!
- X! int compound_depths(compounds)
- X! F_compound *compounds;
- X! {
- X! int maxdepth = 0 ;
- X! F_compound *fp ;
- X!
- X! for (fp = compounds ; fp != NULL ; fp = fp->next )
- X! {
- X! maxdepth = imax(arc_depths(fp->arcs),
- X! imax(line_depths(fp->lines),
- X! imax(ellipse_depths(fp->ellipses),
- X! imax(compound_depths(fp->compounds),
- X! imax(text_depths(fp->texts),
- X! spline_depths(fp->splines)))))) ;
- X! }
- X! return maxdepth ;
- X! }
- X!
- X! /*
- X! * Redisplay a list of arcs. Only display arcs of the correct depth and
- X! * fill mode. For each arc drawn, update the count for the appropriate
- X! * depth in the counts array.
- X! */
- X!
- X! redisplay_arcobject(arcs, depth, fill)
- X! F_arc *arcs;
- X! int depth;
- X! int fill;
- X! {
- X! F_arc *arc;
- X! struct counts *cp = &counts[imin(depth, MAXDEPTH)] ;
- X!
- X! arc = arcs ;
- X! while (arc != NULL && cp->cnt_arcs < cp->num_arcs)
- X! {
- X! if (depth == arc->depth)
- X! if ((fill && arc->area_fill) ||
- X! (fill==0 && arc->area_fill == 0))
- X {
- X! draw_arc(arc, foreground_color) ;
- X! ++cp->cnt_arcs ;
- X }
- X+
- X+ arc = arc->next ;
- X }
- X+ }
- X
- X! /*
- X! * Redisplay a list of ellipses. Only display ellipses of the correct
- X! * depth and fill mode. For each ellipse drawn, update the count for the
- X! * appropriate depth in the counts array.
- X! */
- X!
- X! redisplay_ellipseobject(ellipses, depth, fill)
- X F_ellipse *ellipses;
- X+ int depth;
- X int fill;
- X! {
- X! F_ellipse *ep;
- X! struct counts *cp = &counts[imin(depth, MAXDEPTH)] ;
- X
- X!
- X! ep = ellipses ;
- X! while (ep != NULL && cp->cnt_ellipses < cp->num_ellipses)
- X! {
- X! if (depth == ep->depth)
- X! if ((fill && ep->area_fill) ||
- X! (fill==0 && ep->area_fill == 0))
- X {
- X! draw_ellipse(ep, PAINT) ;
- X! ++cp->cnt_ellipses ;
- X }
- X+
- X+ ep = ep->next ;
- X }
- X+ }
- X
- X! /*
- X! * Redisplay a list of lines. Only display lines of the correct
- X! * depth and fill mode. For each line drawn, update the count for the
- X! * appropriate depth in the counts array.
- X! */
- X!
- X! redisplay_lineobject(lines, depth, fill)
- X F_line *lines;
- X+ int depth;
- X int fill;
- X! {
- X! F_line *lp;
- X! struct counts *cp = &counts[imin(depth, MAXDEPTH)] ;
- X!
- X
- X! lp = lines ;
- X! while (lp != NULL && cp->cnt_lines < cp->num_lines)
- X! {
- X! if (depth == lp->depth)
- X! if ((fill && lp->area_fill) ||
- X! (fill==0 && lp->area_fill == 0))
- X {
- X! draw_line(lp, PAINT) ;
- X! ++cp->cnt_lines ;
- X }
- X+
- X+ lp = lp->next ;
- X }
- X+ }
- X
- X! /*
- X! * Redisplay a list of splines. Only display splines of the correct
- X! * depth and fill mode. For each spline drawn, update the count for the
- X! * appropriate depth in the counts array.
- X! */
- X!
- X! redisplay_splineobject(splines, depth, fill)
- X F_spline *splines;
- X+ int depth;
- X int fill;
- X! {
- X! F_spline *spline;
- X! struct counts *cp = &counts[imin(depth, MAXDEPTH)] ;
- X!
- X! spline = splines ;
- X! while (spline != NULL && cp->cnt_splines < cp->num_splines)
- X! {
- X! if (depth == spline->depth)
- X! if ((fill && spline->area_fill) ||
- X! (fill==0 && spline->area_fill == 0))
- X {
- X! draw_spline(spline, PAINT) ;
- X! ++cp->cnt_splines ;
- X }
- X+
- X+ spline = spline->next ;
- X }
- X+ }
- X
- X! /*
- X! * Redisplay a list of texts. Only display texts of the correct
- X! * depth. For each text drawn, update the count for the appropriate
- X! * depth in the counts array.
- X! */
- X
- X! redisplay_textobject(texts, depth)
- X! F_text *texts;
- X! int depth;
- X! {
- X! F_text *text;
- X! struct counts *cp = &counts[imin(depth, MAXDEPTH)] ;
- X!
- X! text = texts ;
- X! while (text != NULL && cp->cnt_texts < cp->num_texts)
- X! {
- X! if (depth == text->depth)
- X! {
- X! draw_text(text, PAINT) ;
- X! ++cp->cnt_texts ;
- X! }
- X!
- X! text = text->next ;
- X }
- X+ }
- X
- X! /*
- X! * Redisplay a list of compounds at a current depth. Basically
- X! * just farm the work out to the objects contained in the compound.
- X! */
- X!
- X! redisplay_compoundobject(compounds, depth, fill)
- X F_compound *compounds;
- X! int depth ;
- X! int fill ;
- X {
- X F_compound *c;
- X
- X for(c = compounds; c != NULL; c = c->next) {
- X! redisplay_arcobject(c->arcs, depth, fill);
- X! redisplay_compoundobject(c->compounds, depth, fill);
- X! redisplay_ellipseobject(c->ellipses, depth, fill);
- X! redisplay_lineobject(c->lines, depth, fill);
- X! redisplay_splineobject(c->splines, depth, fill);
- X
- X /* no filled text mode, just do text on non-filled pass */
- X if(fill==0) {
- X! redisplay_textobject(c->texts, depth);
- X }
- X }
- X }
- X
- X+ /*
- X+ * Redisplay the entire drawing.
- X+ */
- X redisplay_canvas()
- X {
- X extern F_compound objects;
- X
- X clear_canvas();
- X+
- X set_temp_cursor(&wait_cursor);
- X redisplay_objects(&objects);
- X redisplay_grid();
- X*** @xfig.pl9/remove.c Mon Apr 30 12:13:37 1990
- X--- ./remove.c Mon Jun 3 11:28:19 1991
- X***************
- X*** 13,20 ****
- X #include "object.h"
- X #include "paintop.h"
- X
- X- #define TOLERANCE 7
- X-
- X extern (*canvas_kbd_proc)();
- X extern (*canvas_locmove_proc)();
- X extern (*canvas_leftbut_proc)();
- X--- 13,18 ----
- X***************
- X*** 24,53 ****
- X extern set_popupmenu();
- X
- X
- X extern int foreground_color, background_color;
- X
- X extern int init_remove();
- X
- X remove_selected()
- X {
- X canvas_kbd_proc = null_proc;
- X canvas_locmove_proc = null_proc;
- X! canvas_leftbut_proc = init_remove;
- X canvas_middlebut_proc = null_proc;
- X canvas_rightbut_proc = set_popupmenu;
- X set_cursor(&buster_cursor);
- X }
- X
- X! init_remove(x, y)
- X int x, y;
- X {
- X- extern F_line *line_search();
- X- extern F_arc *arc_search();
- X- extern F_ellipse *ellipse_search();
- X- extern F_text *text_search();
- X- extern F_spline *spline_search();
- X- extern F_compound *compound_search();
- X- extern F_compound objects;
- X F_line *l;
- X F_arc *a;
- X F_ellipse *e;
- X--- 22,51 ----
- X extern set_popupmenu();
- X
- X
- X+ extern F_compound objects;
- X extern int foreground_color, background_color;
- X
- X extern int init_remove();
- X
- X+ extern int init_object_search();
- X+ extern int object_search();
- X+
- X remove_selected()
- X {
- X canvas_kbd_proc = null_proc;
- X canvas_locmove_proc = null_proc;
- X! init_object_search(init_remove);
- X! canvas_leftbut_proc = object_search;
- X canvas_middlebut_proc = null_proc;
- X canvas_rightbut_proc = set_popupmenu;
- X set_cursor(&buster_cursor);
- X }
- X
- X! init_remove(p,type,x, y)
- X! char *p;
- X! int type;
- X int x, y;
- X {
- X F_line *l;
- X F_arc *a;
- X F_ellipse *e;
- X***************
- X*** 54,62 ****
- X F_text *t;
- X F_spline *s;
- X F_compound *c;
- X- int dummy;
- X
- X! if ((c = compound_search(x, y, TOLERANCE, &dummy, &dummy)) != NULL) {
- X draw_compoundbox(c, INV_PAINT);
- X erase_compound(c);
- X delete_compound(&objects.compounds, c);
- X--- 52,61 ----
- X F_text *t;
- X F_spline *s;
- X F_compound *c;
- X
- X! switch(type)
- X! { case O_COMPOUND:
- X! c=(F_compound *) p;
- X draw_compoundbox(c, INV_PAINT);
- X erase_compound(c);
- X delete_compound(&objects.compounds, c);
- X***************
- X*** 64,71 ****
- X set_action_object(F_REMOVE, O_COMPOUND);
- X set_latestcompound(c);
- X set_modifiedflag();
- X! }
- X! else if ((l = line_search(x, y, TOLERANCE, &dummy, &dummy)) != NULL) {
- X toggle_linepointmarker(l);
- X draw_line(l, ERASE);
- X delete_line(&objects.lines, l);
- X--- 63,71 ----
- X set_action_object(F_REMOVE, O_COMPOUND);
- X set_latestcompound(c);
- X set_modifiedflag();
- X! break;
- X! case O_POLYLINE:
- X! l=(F_line *) p;
- X toggle_linepointmarker(l);
- X draw_line(l, ERASE);
- X delete_line(&objects.lines, l);
- X***************
- X*** 73,88 ****
- X set_action_object(F_REMOVE, O_POLYLINE);
- X set_latestline(l);
- X set_modifiedflag();
- X! }
- X! else if ((t = text_search(x, y)) != NULL) {
- X! draw_text(t, INV_PAINT);
- X delete_text(&objects.texts, t);
- X clean_up();
- X set_action_object(F_REMOVE, O_TEXT);
- X set_latesttext(t);
- X set_modifiedflag();
- X! }
- X! else if ((e = ellipse_search(x, y, TOLERANCE, &dummy, &dummy)) != NULL){
- X toggle_ellipsepointmarker(e);
- X draw_ellipse(e, background_color);
- X delete_ellipse(&objects.ellipses, e);
- X--- 73,91 ----
- X set_action_object(F_REMOVE, O_POLYLINE);
- X set_latestline(l);
- X set_modifiedflag();
- X! break;
- X! case O_TEXT:
- X! t=(F_text *) p;
- X! toggle_textpointmarker(t);
- X! draw_text(t, ERASE);
- X delete_text(&objects.texts, t);
- X clean_up();
- X set_action_object(F_REMOVE, O_TEXT);
- X set_latesttext(t);
- X set_modifiedflag();
- X! break;
- X! case O_ELLIPSE:
- X! e=(F_ellipse *) p;
- X toggle_ellipsepointmarker(e);
- X draw_ellipse(e, background_color);
- X delete_ellipse(&objects.ellipses, e);
- X***************
- X*** 90,97 ****
- X set_action_object(F_REMOVE, O_ELLIPSE);
- X set_latestellipse(e);
- X set_modifiedflag();
- X! }
- X! else if ((a = arc_search(x, y, TOLERANCE, &dummy, &dummy)) != NULL){
- X toggle_arcpointmarker(a);
- X draw_arc(a, background_color);
- X delete_arc(&objects.arcs, a);
- X--- 93,101 ----
- X set_action_object(F_REMOVE, O_ELLIPSE);
- X set_latestellipse(e);
- X set_modifiedflag();
- X! break;
- X! case O_ARC:
- X! a=(F_arc *) p;
- X toggle_arcpointmarker(a);
- X draw_arc(a, background_color);
- X delete_arc(&objects.arcs, a);
- X***************
- X*** 99,106 ****
- X set_action_object(F_REMOVE, O_ARC);
- X set_latestarc(a);
- X set_modifiedflag();
- X! }
- X! else if ((s = spline_search(x, y, TOLERANCE, &dummy, &dummy)) != NULL) {
- X toggle_splinepointmarker(s);
- X draw_spline(s, ERASE);
- X delete_spline(&objects.splines, s);
- X--- 103,111 ----
- X set_action_object(F_REMOVE, O_ARC);
- X set_latestarc(a);
- X set_modifiedflag();
- X! break;
- X! case O_SPLINE:
- X! s=(F_spline *) p;
- X toggle_splinepointmarker(s);
- X draw_spline(s, ERASE);
- X delete_spline(&objects.splines, s);
- X***************
- X*** 108,114 ****
- X set_action_object(F_REMOVE, O_SPLINE);
- X set_latestspline(s);
- X set_modifiedflag();
- X! }
- X remove_selected();
- X }
- X
- X--- 113,121 ----
- X set_action_object(F_REMOVE, O_SPLINE);
- X set_latestspline(s);
- X set_modifiedflag();
- X! break;
- X! default: return;
- X! }
- X remove_selected();
- X }
- X
- X***************
- X*** 116,121 ****
- X--- 123,129 ----
- X {
- X extern F_compound objects;
- X extern F_compound saved_objects;
- X+ extern F_compound object_tails;
- X extern int last_action;
- X
- X clean_up();
- X***************
- X*** 132,135 ****
- X--- 140,150 ----
- X objects.lines = NULL;
- X objects.splines = NULL;
- X objects.texts = NULL;
- X+
- X+ object_tails.arcs = NULL;
- X+ object_tails.compounds = NULL;
- X+ object_tails.ellipses = NULL;
- X+ object_tails.lines = NULL;
- X+ object_tails.splines = NULL;
- X+ object_tails.texts = NULL;
- X }
- X*** @xfig.pl9/resources.h Mon Apr 16 11:36:11 1990
- X--- ./resources.h Mon Jun 3 11:16:50 1991
- X***************
- X*** 13,18 ****
- X--- 13,20 ----
- X #define EXTERN extern
- X #endif
- X
- X+ #include "zoom.h" /* for set_marker */
- X+
- X typedef struct
- X {
- X unsigned int x, y, z;
- X***************
- X*** 53,58 ****
- X--- 55,61 ----
- X char *boldFont;
- X float tmp_width;
- X float tmp_height;
- X+ float startfontsize; /* ges 6.2.91 */
- X } appresStruct, *appresPtr;
- X
- X typedef struct
- X***************
- X*** 111,118 ****
- X typedef MenuRec MENU;
- X
- X #define set_marker(win,x,y,w,h,op,pix,z1,z2) \
- X! set_line_stuff(1,SOLID_LINE,0.0,(op)); \
- X! XDrawRectangle(tool_d,(win),gccache[(op)],(x),(y),(w),(h))
- X
- X EXTERN PIXWIN canvas_win,
- X msg_win,
- X--- 114,121 ----
- X typedef MenuRec MENU;
- X
- X #define set_marker(win,x,y,w,h,op,pix,z1,z2) \
- X! set_line_stuff(1,RUBBER_LINE,0.0,(op)); \
- X! zXDrawRectangle(tool_d,(win),gccache[(op)],(x),(y),(w),(h))
- X
- X EXTERN PIXWIN canvas_win,
- X msg_win,
- X*** @xfig.pl9/rotate.c Mon Apr 30 12:13:41 1990
- X--- ./rotate.c Mon Jun 3 10:55:57 1991
- X***************
- X*** 148,154 ****
- X insert_ellipse(&objects.ellipses, ellipse);
- X clean_up();
- X set_action_object(F_CREATE, O_ELLIPSE);
- X! draw_ellipse(ellipse, PAINT);
- X }
- X else {
- X draw_ellipse(e, background_color);
- X--- 148,154 ----
- X insert_ellipse(&objects.ellipses, ellipse);
- X clean_up();
- X set_action_object(F_CREATE, O_ELLIPSE);
- X! draw_ellipse(ellipse, foreground_color);
- X }
- X else {
- X draw_ellipse(e, background_color);
- X*** @xfig.pl9/ruler.c Thu Jul 5 13:42:49 1990
- X--- ./ruler.c Tue Jun 11 16:26:02 1991
- X***************
- X*** 13,18 ****
- X--- 13,25 ----
- X #include "font.h"
- X #include "paintop.h"
- X
- X+ /* The following will create rulers 1.2* initial screen size, so that
- X+ if the user resizes the xfig window, the rulers will have numbers there
- X+ The factor can't be much larger, or the color servers for Vaxstations
- X+ screw up the pixmaps (they can't handle pixmaps much larger than
- X+ the screen) */
- X+ #define OVERFACT 1.2
- X+
- X #define INCH_MARK 8
- X #define HALF_MARK 8
- X #define QUARTER_MARK 6
- X***************
- X*** 33,39 ****
- X
- X static lasty = -100;
- X static lastx = -100;
- X! static int troffx = -7, troffy = -10;
- X static char tr_marker_image[16] = {
- X 0xFE, 0xFF, /* *************** */
- X 0xFC, 0x7F, /* ************* */
- X--- 40,46 ----
- X
- X static lasty = -100;
- X static lastx = -100;
- X! static int troffx = -8, troffy = -10; /* alt: -7 */
- X static char tr_marker_image[16] = {
- X 0xFE, 0xFF, /* *************** */
- X 0xFC, 0x7F, /* ************* */
- X***************
- X*** 45,51 ****
- X 0x00, 0x01, /* * */
- X };
- X static mpr_static(trm_pr, TRM_WID, TRM_HT, 1, tr_marker_image);
- X! static int srroffx = 2, srroffy = -7;
- X static char srr_marker_image[16] = {
- X 0x80, /* * */
- X 0xC0, /* ** */
- X--- 52,58 ----
- X 0x00, 0x01, /* * */
- X };
- X static mpr_static(trm_pr, TRM_WID, TRM_HT, 1, tr_marker_image);
- X! static int srroffx = 2, srroffy = -8; /* alt: -7 */
- X static char srr_marker_image[16] = {
- X 0x80, /* * */
- X 0xC0, /* ** */
- X***************
- X*** 66,72 ****
- X };
- X static mpr_static(srrm_pr, SRM_WID, SRM_HT, 1, srr_marker_image);
- X
- X! static int srloffx = -10, srloffy = -7;
- X static char srl_marker_image[16] = {
- X 0x01, /* * */
- X 0x03, /* ** */
- X--- 73,79 ----
- X };
- X static mpr_static(srrm_pr, SRM_WID, SRM_HT, 1, srr_marker_image);
- X
- X! static int srloffx = -10, srloffy = -8; /* -7 */
- X static char srl_marker_image[16] = {
- X 0x01, /* * */
- X 0x03, /* ** */
- X***************
- X*** 87,103 ****
- X };
- X static mpr_static(srlm_pr, SRM_WID, SRM_HT, 1, srl_marker_image);
- X
- X! static Pixmap toparrow_pm, sidearrow_pm;
- X
- X set_toprulermark(x)
- X int x;
- X {
- X! XClearArea(tool_d, topruler_win,lastx + troffx,
- X TOPRULER_HEIGHT + troffy,trm_pr.width,
- X trm_pr.height, False);
- X XCopyArea(tool_d, toparrow_pm, topruler_win, topgc,
- X 0, 0, trm_pr.width, trm_pr.height,
- X! x + troffx, TOPRULER_HEIGHT + troffy);
- X lastx = x;
- X }
- X
- X--- 94,112 ----
- X };
- X static mpr_static(srlm_pr, SRM_WID, SRM_HT, 1, srl_marker_image);
- X
- X! static Pixmap toparrow_pm=0, sidearrow_pm=0;
- X
- X+ static Pixmap topruler_pm=0, sideruler_pm=0;
- X+
- X set_toprulermark(x)
- X int x;
- X {
- X! XClearArea(tool_d, topruler_win,ZOOMX(lastx) + troffx,
- X TOPRULER_HEIGHT + troffy,trm_pr.width,
- X trm_pr.height, False);
- X XCopyArea(tool_d, toparrow_pm, topruler_win, topgc,
- X 0, 0, trm_pr.width, trm_pr.height,
- X! ZOOMX(x) + troffx, TOPRULER_HEIGHT + troffy);
- X lastx = x;
- X }
- X
- X***************
- X*** 192,200 ****
- X XDefineCursor(tool_d, sideruler_win, (Cursor)bull_cursor.bitmap);
- X
- X /* top ruler, adjustments for digits are kludges based on 6x13 char */
- X p = XCreatePixmap(tool_d, topruler_win,
- X! TOPRULER_WIDTH, TOPRULER_HEIGHT,
- X DefaultDepthOfScreen(tool_s));
- X
- X XtSetArg(tmp_arg[0], XtNbackground, &bg);
- X XtSetArg(tmp_arg[1], XtNforeground, &fg);
- X--- 201,212 ----
- X XDefineCursor(tool_d, sideruler_win, (Cursor)bull_cursor.bitmap);
- X
- X /* top ruler, adjustments for digits are kludges based on 6x13 char */
- X+ if (topruler_pm!=NULL) XFreePixmap(tool_d, topruler_pm);
- X+
- X p = XCreatePixmap(tool_d, topruler_win,
- X! (int)(OVERFACT*TOPRULER_WIDTH), TOPRULER_HEIGHT,
- X DefaultDepthOfScreen(tool_s));
- X+ topruler_pm=p;
- X
- X XtSetArg(tmp_arg[0], XtNbackground, &bg);
- X XtSetArg(tmp_arg[1], XtNforeground, &fg);
- X***************
- X*** 202,208 ****
- X
- X XSetBackground(tool_d, gc, bg);
- X XSetForeground(tool_d, gc, bg);
- X! XFillRectangle(tool_d, p, gc, 0, 0, TOPRULER_WIDTH,
- X TOPRULER_HEIGHT);
- X XSetForeground(tool_d, gc, fg);
- X
- X--- 214,220 ----
- X
- X XSetBackground(tool_d, gc, bg);
- X XSetForeground(tool_d, gc, bg);
- X! XFillRectangle(tool_d, p, gc, 0, 0, (int)(OVERFACT*TOPRULER_WIDTH),
- X TOPRULER_HEIGHT);
- X XSetForeground(tool_d, gc, fg);
- X
- X***************
- X*** 209,251 ****
- X XDrawString(tool_d, p, gc, 2, TOPRULER_HEIGHT - INCH_MARK - 3,
- X appres.INCHES ? "in" : "cm", 2);
- X if(appres.INCHES)
- X! for (i = SINCH - 1; i <= TOPRULER_WIDTH; i += SINCH)
- X {
- X j = i + 1;
- X if (j % PIX_PER_INCH == 0)
- X {
- X! XDrawLine(tool_d, p, gc, i, TOPRULER_HEIGHT - 1, i,
- X TOPRULER_HEIGHT - INCH_MARK - 1);
- X sprintf(number, "%d", j / PIX_PER_INCH);
- X! XDrawString(tool_d, p, gc, i - 3,
- X TOPRULER_HEIGHT - INCH_MARK - 3, number,
- X j < PIX_PER_INCH * 10 ? 1 : 2);
- X }
- X else if (j % HINCH == 0)
- X! XDrawLine(tool_d, p, gc, i, TOPRULER_HEIGHT - 1, i,
- X TOPRULER_HEIGHT - HALF_MARK - 1);
- X else if (j % QINCH == 0)
- X! XDrawLine(tool_d, p, gc, i, TOPRULER_HEIGHT - 1, i,
- X TOPRULER_HEIGHT - QUARTER_MARK - 1);
- X else if (j % SINCH == 0)
- X! XDrawLine(tool_d, p, gc, i, TOPRULER_HEIGHT - 1, i,
- X TOPRULER_HEIGHT - SIXTEENTH_MARK - 1);
- X }
- X else
- X! for (i = TWOMM - 1; i <= TOPRULER_WIDTH; i++)
- X {
- X j = i + 1;
- X if (j % PIX_PER_CM == 0)
- X {
- X! XDrawLine(tool_d, p, gc, i, TOPRULER_HEIGHT - 1, i,
- X TOPRULER_HEIGHT - INCH_MARK - 1);
- X sprintf(number, "%d", j / PIX_PER_CM);
- X! XDrawString(tool_d, p, gc, i - 3,
- X TOPRULER_HEIGHT - INCH_MARK - 3, number,
- X j < PIX_PER_CM * 10 ? 1 : 2);
- X }
- X else if (j % TWOMM == 0)
- X! XDrawLine(tool_d, p, gc, i, TOPRULER_HEIGHT - 1, i,
- X TOPRULER_HEIGHT - QUARTER_MARK - 1);
- X }
- X ruler_args[0].value = (XtArgVal) p;
- X--- 221,263 ----
- X XDrawString(tool_d, p, gc, 2, TOPRULER_HEIGHT - INCH_MARK - 3,
- X appres.INCHES ? "in" : "cm", 2);
- X if(appres.INCHES)
- X! for (i = SINCH - 1; i <= (int)(OVERFACT*TOPRULER_WIDTH); i += SINCH)
- X {
- X j = i + 1;
- X if (j % PIX_PER_INCH == 0)
- X {
- X! XDrawLine(tool_d, p, gc, ZOOMX(i), TOPRULER_HEIGHT - 1, ZOOMX(i),
- X TOPRULER_HEIGHT - INCH_MARK - 1);
- X sprintf(number, "%d", j / PIX_PER_INCH);
- X! XDrawString(tool_d, p, gc, ZOOMX(i) - 3,
- X TOPRULER_HEIGHT - INCH_MARK - 3, number,
- X j < PIX_PER_INCH * 10 ? 1 : 2);
- X }
- X else if (j % HINCH == 0)
- X! XDrawLine(tool_d, p, gc, ZOOMX(i), TOPRULER_HEIGHT - 1, ZOOMX(i),
- X TOPRULER_HEIGHT - HALF_MARK - 1);
- X else if (j % QINCH == 0)
- X! XDrawLine(tool_d, p, gc, ZOOMX(i), TOPRULER_HEIGHT - 1, ZOOMX(i),
- X TOPRULER_HEIGHT - QUARTER_MARK - 1);
- X else if (j % SINCH == 0)
- X! XDrawLine(tool_d, p, gc, ZOOMX(i), TOPRULER_HEIGHT - 1, ZOOMX(i),
- X TOPRULER_HEIGHT - SIXTEENTH_MARK - 1);
- X }
- X else
- X! for (i = TWOMM - 1; i <= (int)(OVERFACT*TOPRULER_WIDTH); i++)
- X {
- X j = i + 1;
- X if (j % PIX_PER_CM == 0)
- X {
- X! XDrawLine(tool_d, p, gc, ZOOMX(i), TOPRULER_HEIGHT - 1, ZOOMX(i),
- X TOPRULER_HEIGHT - INCH_MARK - 1);
- X sprintf(number, "%d", j / PIX_PER_CM);
- X! XDrawString(tool_d, p, gc, ZOOMX(i) - 3,
- X TOPRULER_HEIGHT - INCH_MARK - 3, number,
- X j < PIX_PER_CM * 10 ? 1 : 2);
- X }
- X else if (j % TWOMM == 0)
- X! XDrawLine(tool_d, p, gc, ZOOMX(i), TOPRULER_HEIGHT - 1, ZOOMX(i),
- X TOPRULER_HEIGHT - QUARTER_MARK - 1);
- X }
- X ruler_args[0].value = (XtArgVal) p;
- X***************
- X*** 264,269 ****
- X--- 276,282 ----
- X XSetBackground(tool_d, gc, (unsigned long) 0);
- X
- X /* make pixmaps for top ruler arrow */
- X+ if (toparrow_pm==NULL)
- X toparrow_pm = XCreatePixmap(tool_d, topruler_win, trm_pr.width,
- X trm_pr.height,
- X DefaultDepthOfScreen(tool_s));
- X***************
- X*** 271,279 ****
- X trm_pr.width, trm_pr.height);
- X
- X /* side ruler, adjustments for digits are kludges based on 6x13 char */
- X p = XCreatePixmap(tool_d, sideruler_win,
- X! SIDERULER_WIDTH, SIDERULER_HEIGHT,
- X DefaultDepthOfScreen(tool_s));
- X XtSetArg(tmp_arg[0], XtNbackground, &bg);
- X XtSetArg(tmp_arg[1], XtNforeground, &fg);
- X XtGetValues(sideruler_sw, tmp_arg, 2);
- X--- 284,295 ----
- X trm_pr.width, trm_pr.height);
- X
- X /* side ruler, adjustments for digits are kludges based on 6x13 char */
- X+ if (sideruler_pm!=NULL) XFreePixmap(tool_d,sideruler_pm);
- X p = XCreatePixmap(tool_d, sideruler_win,
- X! SIDERULER_WIDTH, (int)(OVERFACT*SIDERULER_HEIGHT),
- X DefaultDepthOfScreen(tool_s));
- X+ sideruler_pm=p;
- X+
- X XtSetArg(tmp_arg[0], XtNbackground, &bg);
- X XtSetArg(tmp_arg[1], XtNforeground, &fg);
- X XtGetValues(sideruler_sw, tmp_arg, 2);
- X***************
- X*** 281,287 ****
- X XSetBackground(tool_d, gc, bg);
- X XSetForeground(tool_d, gc, bg);
- X XFillRectangle(tool_d, p, gc, 0, 0, SIDERULER_WIDTH,
- X! SIDERULER_HEIGHT);
- X XSetForeground(tool_d, gc, fg);
- X
- X if( appres.INCHES )
- X--- 297,303 ----
- X XSetBackground(tool_d, gc, bg);
- X XSetForeground(tool_d, gc, bg);
- X XFillRectangle(tool_d, p, gc, 0, 0, SIDERULER_WIDTH,
- X! (int)(OVERFACT*SIDERULER_HEIGHT));
- X XSetForeground(tool_d, gc, fg);
- X
- X if( appres.INCHES )
- X***************
- X*** 288,335 ****
- X {
- X if( appres.RHS_PANEL )
- X {
- X! for (i = SINCH - 1; i <= SIDERULER_HEIGHT; i += SINCH)
- X {
- X j = i + 1;
- X if (j % PIX_PER_INCH == 0)
- X {
- X XDrawLine(tool_d, p, gc, RULER_WIDTH-INCH_MARK,
- X! i, RULER_WIDTH, i);
- X sprintf(number, "%d", j / PIX_PER_INCH);
- X XDrawString(tool_d, p, gc,
- X! RULER_WIDTH-INCH_MARK - 8, i + 3,
- X number, j < PIX_PER_INCH * 10 ? 1 : 2);
- X }
- X else if (j % QINCH == 0)
- X XDrawLine(tool_d, p, gc,
- X! RULER_WIDTH-QUARTER_MARK, i,
- X! RULER_WIDTH, i);
- X else if (j % SINCH == 0)
- X XDrawLine(tool_d, p, gc,
- X! RULER_WIDTH-SIXTEENTH_MARK, i,
- X! RULER_WIDTH, i);
- X }
- X }
- X else
- X {
- X! for (i = SINCH - 1; i <= SIDERULER_HEIGHT; i += SINCH)
- X {
- X j = i + 1;
- X if (j % PIX_PER_INCH == 0)
- X {
- X! XDrawLine(tool_d, p, gc, 0, i,
- X! INCH_MARK - 1, i);
- X sprintf(number, "%d", j / PIX_PER_INCH);
- X XDrawString(tool_d, p, gc, INCH_MARK + 3,
- X! i + 3, number,
- X j < PIX_PER_INCH * 10 ? 1 : 2);
- X }
- X else if (j % QINCH == 0)
- X! XDrawLine(tool_d, p, gc, 0, i,
- X! QUARTER_MARK - 1, i);
- X else if (j % SINCH == 0)
- X! XDrawLine(tool_d, p, gc, 0, i,
- X! SIXTEENTH_MARK - 1, i);
- X }
- X }
- X }
- X--- 304,351 ----
- X {
- X if( appres.RHS_PANEL )
- X {
- X! for (i = SINCH - 1; i <= (int)(OVERFACT*SIDERULER_HEIGHT); i += SINCH)
- X {
- X j = i + 1;
- X if (j % PIX_PER_INCH == 0)
- X {
- X XDrawLine(tool_d, p, gc, RULER_WIDTH-INCH_MARK,
- X! ZOOMY(i), RULER_WIDTH, ZOOMY(i));
- X sprintf(number, "%d", j / PIX_PER_INCH);
- X XDrawString(tool_d, p, gc,
- X! RULER_WIDTH-INCH_MARK - 8, ZOOMY(i) + 3,
- X number, j < PIX_PER_INCH * 10 ? 1 : 2);
- X }
- X else if (j % QINCH == 0)
- X XDrawLine(tool_d, p, gc,
- X! RULER_WIDTH-QUARTER_MARK, ZOOMY(i),
- X! RULER_WIDTH, ZOOMY(i));
- X else if (j % SINCH == 0)
- X XDrawLine(tool_d, p, gc,
- X! RULER_WIDTH-SIXTEENTH_MARK, ZOOMY(i),
- X! RULER_WIDTH, ZOOMY(i));
- X }
- X }
- X else
- X {
- X! for (i = SINCH - 1; i <= (int)(OVERFACT*SIDERULER_HEIGHT); i += SINCH)
- X {
- X j = i + 1;
- X if (j % PIX_PER_INCH == 0)
- X {
- X! XDrawLine(tool_d, p, gc, 0, ZOOMY(i),
- X! INCH_MARK - 1, ZOOMY(i));
- X sprintf(number, "%d", j / PIX_PER_INCH);
- X XDrawString(tool_d, p, gc, INCH_MARK + 3,
- X! ZOOMY(i) + 3, number,
- X j < PIX_PER_INCH * 10 ? 1 : 2);
- X }
- X else if (j % QINCH == 0)
- X! XDrawLine(tool_d, p, gc, 0, ZOOMY(i),
- X! QUARTER_MARK - 1, ZOOMY(i));
- X else if (j % SINCH == 0)
- X! XDrawLine(tool_d, p, gc, 0, ZOOMY(i),
- X! SIXTEENTH_MARK - 1, ZOOMY(i));
- X }
- X }
- X }
- X***************
- X*** 337,377 ****
- X {
- X if( appres.RHS_PANEL )
- X {
- X! for (i = TWOMM - 1; i <= SIDERULER_HEIGHT; i++)
- X {
- X j = i + 1;
- X if (j % PIX_PER_CM == 0)
- X {
- X XDrawLine(tool_d, p, gc, RULER_WIDTH-INCH_MARK,
- X! i, RULER_WIDTH, i);
- X sprintf(number, "%d", j / PIX_PER_CM);
- X XDrawString(tool_d, p, gc,
- X! RULER_WIDTH-INCH_MARK - 8, i + 3,
- X number, j < PIX_PER_CM * 10 ? 1 : 2);
- X }
- X else if (j % TWOMM == 0)
- X XDrawLine(tool_d, p, gc,
- X! RULER_WIDTH-QUARTER_MARK, i,
- X! RULER_WIDTH, i);
- X }
- X }
- X else
- X {
- X! for (i = TWOMM - 1; i <= SIDERULER_HEIGHT; i++)
- X {
- X j = i + 1;
- X if (j % PIX_PER_CM == 0)
- X {
- X! XDrawLine(tool_d, p, gc, 0, i,
- X! INCH_MARK - 1, i);
- X sprintf(number, "%d", j / PIX_PER_CM);
- X XDrawString(tool_d, p, gc, INCH_MARK + 3,
- X! i + 3, number,
- X j < PIX_PER_CM * 10 ? 1 : 2);
- X }
- X else if (j % TWOMM == 0)
- X! XDrawLine(tool_d, p, gc, 0, i,
- X! QUARTER_MARK - 1, i);
- X }
- X }
- X }
- X--- 353,393 ----
- X {
- X if( appres.RHS_PANEL )
- X {
- X! for (i = TWOMM - 1; i <= (int)(OVERFACT*SIDERULER_HEIGHT); i++)
- X {
- X j = i + 1;
- X if (j % PIX_PER_CM == 0)
- X {
- X XDrawLine(tool_d, p, gc, RULER_WIDTH-INCH_MARK,
- X! ZOOMY(i), RULER_WIDTH, ZOOMY(i));
- X sprintf(number, "%d", j / PIX_PER_CM);
- X XDrawString(tool_d, p, gc,
- X! RULER_WIDTH-INCH_MARK - 8, ZOOMY(i) + 3,
- X number, j < PIX_PER_CM * 10 ? 1 : 2);
- X }
- X else if (j % TWOMM == 0)
- X XDrawLine(tool_d, p, gc,
- X! RULER_WIDTH-QUARTER_MARK, ZOOMY(i),
- X! RULER_WIDTH, ZOOMY(i));
- X }
- X }
- X else
- X {
- X! for (i = TWOMM - 1; i <= (int)(OVERFACT*SIDERULER_HEIGHT); i++)
- X {
- X j = i + 1;
- X if (j % PIX_PER_CM == 0)
- X {
- X! XDrawLine(tool_d, p, gc, 0, ZOOMY(i),
- X! INCH_MARK - 1, ZOOMY(i));
- X sprintf(number, "%d", j / PIX_PER_CM);
- X XDrawString(tool_d, p, gc, INCH_MARK + 3,
- X! ZOOMY(i) + 3, number,
- X j < PIX_PER_CM * 10 ? 1 : 2);
- X }
- X else if (j % TWOMM == 0)
- X! XDrawLine(tool_d, p, gc, 0, ZOOMY(i),
- X! QUARTER_MARK - 1, ZOOMY(i));
- X }
- X }
- X }
- X***************
- X*** 385,390 ****
- X--- 401,407 ----
- X /* make pixmaps for side ruler arrow */
- X if( appres.RHS_PANEL )
- X {
- X+ if (sidearrow_pm==NULL)
- X sidearrow_pm = XCreatePixmap(tool_d, sideruler_win,
- X srlm_pr.width, srlm_pr.height,
- X DefaultDepthOfScreen(tool_s));
- X***************
- X*** 393,398 ****
- X--- 410,416 ----
- X }
- X else
- X {
- X+ if (sidearrow_pm==NULL)
- X sidearrow_pm = XCreatePixmap(tool_d, sideruler_win,
- X srrm_pr.width, srrm_pr.height,
- X DefaultDepthOfScreen(tool_s));
- X***************
- X*** 424,434 ****
- X /* Because the ruler uses a background pixmap, we can win
- X here by using XClearArea to erase the old thing. */
- X XClearArea(tool_d, sideruler_win,
- X! RULER_WIDTH+srloffx, lasty + srloffy,
- X srlm_pr.width, srlm_pr.height, False);
- X XCopyArea(tool_d, sidearrow_pm, sideruler_win,
- X sidegc, 0, 0, srlm_pr.width,
- X! srlm_pr.height, RULER_WIDTH+srloffx, y + srloffy);
- X }
- X else
- X {
- X--- 442,453 ----
- X /* Because the ruler uses a background pixmap, we can win
- X here by using XClearArea to erase the old thing. */
- X XClearArea(tool_d, sideruler_win,
- X! RULER_WIDTH+srloffx, ZOOMY(lasty) + srloffy,
- X srlm_pr.width, srlm_pr.height, False);
- X XCopyArea(tool_d, sidearrow_pm, sideruler_win,
- X sidegc, 0, 0, srlm_pr.width,
- X! srlm_pr.height, RULER_WIDTH+srloffx,
- X! ZOOMY(y) + srloffy);
- X }
- X else
- X {
- X***************
- X*** 435,445 ****
- X /* Because the ruler uses a background pixmap, we can win
- X here by using XClearArea to erase the old thing. */
- X XClearArea(tool_d, sideruler_win,
- X! srroffx, lasty + srroffy,
- X srlm_pr.width, srlm_pr.height, False);
- X XCopyArea(tool_d, sidearrow_pm, sideruler_win,
- X sidegc, 0, 0, srrm_pr.width,
- X! srrm_pr.height, srroffx, y + srroffy);
- X }
- X lasty = y;
- X }
- X--- 454,464 ----
- X /* Because the ruler uses a background pixmap, we can win
- X here by using XClearArea to erase the old thing. */
- X XClearArea(tool_d, sideruler_win,
- X! srroffx, ZOOMY(lasty) + srroffy,
- X srlm_pr.width, srlm_pr.height, False);
- X XCopyArea(tool_d, sidearrow_pm, sideruler_win,
- X sidegc, 0, 0, srrm_pr.width,
- X! srrm_pr.height, srroffx, ZOOMY(y) + srroffy);
- X }
- X lasty = y;
- X }
- END_OF_FILE
- if test 51091 -ne `wc -c <'patch10.3'`; then
- echo shar: \"'patch10.3'\" unpacked with wrong size!
- fi
- # end of 'patch10.3'
- fi
- echo shar: End of archive 2 \(of 4\).
- cp /dev/null ark2isdone
- MISSING=""
- for I in 1 2 3 4 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 4 archives.
- rm -f ark[1-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-
- --
- Dan Heller
- O'Reilly && Associates Z-Code Software Comp-sources-x:
- Senior Writer President comp-sources-x@uunet.uu.net
- argv@ora.com argv@zipcode.com
-